﻿@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()
        <ul class="nav navbar-nav navbar-right nav navbar-nav">
            <li class="dropdown nav-item">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    @User.Identity.GetUserName()<b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li>@Html.ActionLink("Профиль", "Index", "Profile")</li>
                    <li>@Html.ActionLink("Панель администратора", "Dashboard", "Admin")</li>
                    <li class="divider"></li>
                    <li><a href="javascript:document.getElementById('logoutForm').submit()">Выйти</a></li>
                </ul>
            </li>
        </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right nav navbar-nav">
        <li class="nav-item last">@Html.ActionLink("Войти", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}
